export default {
  computed: {
    getPath() {
      return function(path) {
        return (path.includes('https://') || path.includes('http://')) ? `${path}` : require(`@/assets/custorm_style/${path}`)
      }
    }
  },
  props: {
    defaultConfig: {
      type: Object,
      required: true
    },
    custormEvt: Function,
    custormItemData: Object,
    custormIndex: Number,
    custormCurrent: Number
  },
  methods: {
    custormEvent(...arg) {
      // console.log('666666666666666+++++++++++++++++', this.custormEvt)
      // console.log('666666666666666+++++++++++++++++', ...arg)
      this.custormEvt(...arg)
    },
    clickCurrent(type = 'current', redirect = false) {
      console.log(222, type, this.custormIndex)
      if (!redirect) {
        let params = this.custormIndex
        switch (type) {
          case 'dragging':
            params = this.custormItemData.id
            break
        }
        this.custormEvent(type, params)
      } else {
        this.custormEvent(type, redirect)
      }
    },
    delCurrent() {
      this.custormEvent('deleted', this.custormIndex)
    },
    output() {
      if (
        Object.prototype.toString.call(this.changeEvt) === '[object Function]'
      ) {
        this.custormEditEvt()
      }
    }
  }
}
